package com.shycloud.mido.music.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shycloud.mido.common.core.util.R;
import com.shycloud.mido.music.service.MisMyCollectionMusicService;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @author nianhua.jiang
 * @description 我的曲目模块 controller
 * @date 2020/6/18
 */
@RestController
@RequestMapping("myMusic")
@AllArgsConstructor
@ApiIgnore
public class MyMusicController {

	/** 自建曲集与曲目关系 service */
	private MisMyCollectionMusicService misMyCollectionMusicService;

	/**
	 * 获取自建曲集下的曲目列表
	 *
	 * @param current
	 * @param size
	 * @param myCollectionId
	 * @return com.shycloud.mido.common.core.util.R
	 * @author nianhua.jiang
	 * @date 2020/6/18 11:06
	 */
	@GetMapping("getMyMusic")
	@ApiOperation("获取自建曲集下的曲目列表")
	public R getMyMusic(Integer current, Integer size, Integer myCollectionId) {
		return new R(misMyCollectionMusicService.getMyMusic(new Page(current, size), myCollectionId));
	}

}
